//常量
export default {

  //企业数据类型
  orgTypeOption: {
    tooltip: {
      trigger: 'item',
      formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
      orient: 'vertical',
      x: 'right',
      align: 'left',
      top: '40',
      padding: [0,10,0,0],
      formatter: (name) => {
        return name;
      },
      data: ["建设单位", "施工单位", "监理单位", "勘察设计", "图审单位", "检测机构"],
    },
    color: ['red', 'orange', 'blue', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'],
    series: [
      {
        name:'企业归属地',
        type:'pie',
        selectedMode: 'single',
        radius: [0, '40%'],
        center: ['34%', '40%'],
        label: {
          normal: {
            position: 'inner'
          }
        },
        labelLine: {
          normal: {
            show: false
          }
        },
        data:[
          {name:'本地', value: 0},
          {name:'外地', value: 0}
        ]
      },
      {
        name: '企业资质类型',
        type: 'pie',
        radius: ['45%', '70%'],
        center: ['34%', '40%'],
        avoidLabelOverlap: false,
        formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}{per|{d}%}',
        label: {
          normal: {
            show: false,
            position: 'center',
          },
          emphasis: {
            show: false,
            textStyle: {
              fontSize: '16',
              fontWeight: 'bold'
            }
          }
        },
        labelLine: {
          normal: {
            show: true,
          }
        },
        data: [
          {name: "建设单位", value: 0},
          {name: "施工单位", value: 0},
          {name: "监理单位", value: 0},
          {name: "勘察设计", value: 0},
          {name: "图审单位", value: 0},
          {name: "检测机构", value: 0},
          {name: "建设单位", value: 0},
          {name: "施工单位", value: 0},
          {name: "监理单位", value: 0},
          {name: "勘察设计", value: 0},
          {name: "图审单位", value: 0},
          {name: "检测机构", value: 0}
        ]
      }
    ]
  },

  //登记人员证书分类数据
  ryzsTypeOption: {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
      formatter: "{a} <br/>{b}: {c}(个)",
    },
    grid: {
      left: "5%",
      right: "5%",
      top: "10",
      bottom: "34%",
      containLabel: true,
    },
    xAxis: [
      {
        type: "category",
        show: false,
        data: [],
      },
    ],
    yAxis: [
      {
        type: "value",
        show: true,
      },
    ],
    series: [
      {
        name: "人员证书分类数据（全部）",
        type: "bar",
        itemStyle: {
          normal: {
            color: function (params) {
              // build a color map as your need.
              let colorList = [
                "#C1232B",
                "#B5C334",
                "#FCCE10",
                "#E87C25",
                "#27727B",
                "#FE8463",
                "#9BCA63",
                "#FAD860",
                "#F3A43B",
                "#60C0DD",
                "#D7504B",
                "#C6E579",
                "#F4E001",
                "#F0805A",
                "#26C0C0",
                "#C1232B",
                "#B5C334",
                "#FCCE10",
                "#E87C25",
                "#27727B",
                "#FE8463",
                "#9BCA63",
                "#FAD860",
                "#F3A43B",
                "#60C0DD",
                "#D7504B",
                "#C6E579",
                "#F4E001",
                "#F0805A",
                "#26C0C0",
              ];
              return colorList[params.dataIndex];
            },
            label: {
              show: true,
              position: "bottom",
              formatter: "{b}",
              rotate: -40,
              offset: [30, 20],
            },
          },
        },
        data: [],
      },
    ],
  },

  //登记人员分类
  ryTypeption: {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      },
      formatter: "{a} <br/>{b}: {c}(个)"
    },
    grid: {
      left: '5%',
      right: '5%',
      top: '10',
      bottom: '34%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        show: false,
        data: [],
      }
    ],
    yAxis: [
      {
        type: 'value',
        show: true
      }
    ],
    series: [
      {
        name: '登记人员证书分类数据',
        type: 'bar',
        itemStyle: {
          normal: {
            color: function (params) {
              // build a color map as your need.
              let colorList = [
                '#C1232B', '#B5C334', '#FCCE10', '#E87C25', '#27727B',
                '#FE8463', '#9BCA63', '#FAD860', '#F3A43B', '#60C0DD',
                '#D7504B', '#C6E579', '#F4E001', '#F0805A', '#26C0C0'
              ];
              return colorList[params.dataIndex]
            },
            label: {
              show: true,
              position: 'bottom',
              formatter: '{b}',
              rotate: -40,
              offset: [30, 20]
            }
          }
        },
        data: ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0"]
      }
    ]
  },

  // 企业信用评级数据
  ocrOptions: {
    tooltip: {
      show: true,
      formatter: "{b}:{c}家"
    },
    grid: {
      left: '20%',
      right: '12%',
      top: '10',
      bottom: '30%',
    },
    xAxis: [{
      axisTick: {
        show: false,
      },
      axisLine: {
        show: false,
      },
      axisLabel: {
        show: false
      },
      splitLine: {
        show: false,
      }
    }],
    yAxis: [{
      type: 'category',
      data: ["A级", "B级", "C级"],
      axisTick: {
        show: false,
      },
      axisLine: {
        show: false,
      },
      axisLabel: {
        textStyle: {
          color: '#000000',
        },
      }
    }],
    series: [
      // {
      //   name: '1',
      //   type: 'bar',
      //   barWidth: 16,
      //   silent: true,
      //   itemStyle: {
      //     normal: {
      //       color: '#0B2A54',
      //       barBorderRadius: [0, 5, 5, 0],
      //     }
      //   },
      //   barGap: '-100%',
      //   barCategoryGap: '50%',
      //   data: [100, 100, 100].map(function () {
      //     return 5000
      //   }),
      // },
      {
        name: '2',
        type: 'bar',
        barWidth: 16,
        label: {
          normal: {
            show: true,
            position: 'top',
            formatter: '{c}家',
          }
        },
        data: [
          {
            name: 'A级企业',
            value: 0,
            itemStyle: {
              normal: {
                barBorderRadius: [0, 10, 10, 0],
                color: {
                  type: 'bar',
                  colorStops: [{
                    offset: 0,
                    color: 'rgba(11,42,84,.3)' // 0% 处的颜色
                  }, {
                    offset: 1,
                    color: '#ffa800' // 100% 处的颜色
                  }],
                  globalCoord: false, // 缺省为 false
                }
              }
            }
          },
          {
            name: 'B级企业',
            value: 0,
            itemStyle: {
              normal: {
                barBorderRadius: [0, 10, 10, 0],
                color: {
                  type: 'bar',
                  colorStops: [{
                    offset: 0,
                    color: 'rgba(11,42,84,.3)' // 0% 处的颜色
                  }, {
                    offset: 1,
                    color: '#b250ff' // 100% 处的颜色
                  }],
                  globalCoord: false, // 缺省为 false

                }
              }
            }
          },
          {
            name: 'C级企业',
            value: 0,
            itemStyle: {
              normal: {
                barBorderRadius: [0, 10, 10, 0],
                color: {
                  type: 'bar',
                  colorStops: [{
                    offset: 0,
                    color: 'rgba(11,42,84,.3)' // 0% 处的颜色
                  }, {
                    offset: 1,
                    color: '#4f9aff' // 100% 处的颜色
                  }],
                  globalCoord: false, // 缺省为 false

                }
              }
            }
          }
        ],
      }
    ]
  },
  // 个人信用评级数据
  pcrOptions: {

    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      },
      formatter: "{a} <br/>{b}: {c}(人)"
    },
    grid: {
      left: '8%',
      right: '10%',
      top: '10',
      bottom: '31%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        show: false,
        data: ["A级", "B级", "C级"],
      }
    ],
    yAxis: [
      {
        type: 'value',
        show: true
      }
    ],
    series: [
      {
        name: '个人信用评级数据',
        type: 'bar',
        itemStyle: {
          normal: {
            color: function (params) {
              // build a color map as your need.
              let colorList = [
                '#B22222', '#EE7600', '#1A1A1A'
              ];
              return colorList[params.dataIndex]
            },
            label: {
              show: true,
              position: 'bottom',
              formatter: '{b}',
              // rotate: -40,
              // offset: [30, 20]
            }
          }
        },
        data: ["0", "0", "0"]
      }
    ]
  },
}
